package com.amrit.annotation;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MainApp {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
		ctx.register(HelloWorldConfig.class);
		ctx.refresh();

		HelloWorld helloWorld = ctx.getBean(HelloWorld.class);
		HelloWorld helloWorld1 = ctx.getBean(HelloWorld.class);

		helloWorld.setMessage("Hello World!");
		System.out.println(helloWorld);
		System.out.println(helloWorld1);
		helloWorld.getMessage();
	}
}
